{%extends file='../../../layout/base.tpl'%}

{%block name="head_end"%}
	{%require name="static/logic/cashier/h5/payment.less"%}
	<script type="text/javascript">
		var pmi = '{%$result.pmi%}';
		var midas_env = '{%$result.midas_env%}';
		var redirect_url = '{%$result.redirect_url%}';
		var isAuth = '{%$result.isAuth%}';
	</script>
{%/block%}

{%block name="body_main"%}
	<div id="app" class="container payment-body" v-cloak>
		{%if $result.isIllegal%}
			<div class="error-title">{%$result.merchant_title%}</div>
			<div class="error-msg">该店由于违规行为，暂不属于云南诚信联盟</div>
			<a href="{%$result.redirect_url%}" class="weui-btn weui-btn_primary btn-more">其他诚信商家</a>
		{%else%}
		<image class="cx-icon" src="http://mat1.gtimg.com/auto/2018/wiimock/1.0.2/gold.png">
		<div class="credit-level">{%$result.credit_level_title%}</div>
		<div class="merchant-title">{%$result.merchant_title%}</div>
		{%if $result.isPay%}
		<keyinput ref="virtualInput"
	    v-model="amount"
	    :placeholder="placeText"
	    :is-auto-focus="true"
	    @show-key-board="showKeyBoard"></keyinput>
		<div class="introduction">{%$result.introduction%}</div>
		<div class="credit_tag">
			{%foreach $result.credit_tag as $tag%}
				<span><i class="sicon sicon-ic_yes"></i>{%$tag%}</span>
			{%/foreach%}
		</div>
		<keyboard ref="virtualKeyBoard" @on-callback="submit"></keyboard>
		{%else%}
		<div class="seller-clause">
			<div class="clause-item">
				<span class="clause-label">投诉：</span>
				<span>最近3个月内,有效投诉率低于1%</span>
			</div>
			<div class="clause-item">
				<span class="clause-label">评价：</span>
				<span>最近3个月内，5星好评率超过90%</span>
			</div>
			<div class="clause-item">
				<span class="clause-label">其他：</span>
				<span>无违法违规经营行为</span>
			</div>
		</div>

		<a href="javascript:;" class="weui-btn weui-btn_primary btn-evaluate" @click="showEvaluate">评价</a>

		<a href="{%$result.redirect_url%}" class="more-link">更多诚信商家</a>

		<wii-popup v-model="evaluateShow" @on-hide="popupHandler('hide')" @on-show="popupHandler('show')" >
			<form action="/api/evaluate" method="post" accept-charset="utf-8">
			    <div class="wii-popup-body">
			        <div class="wii-popup-title">您在这家店的体验如何</div>
					
					<div class="rater-body">
						<wii-rater name="star" :fontSize="20"></wii-rater>
					</div>

			        <a href="javascript:;" class="weui-btn weui-btn_primary btn-submit" @click="submitEvaluate">提交</a>
			    </div>
			</form>
		</wii-popup>

		<wii-popup v-model="authShow" @on-hide="popupHandler('hide')" @on-show="popupHandler('show')" >
		    <div class="wii-popup-body">
		        <div class="wii-popup-title">您在这家店的体验如何</div>
				
				<form action="/api/auth" method="post" accept-charset="utf-8">
					<div class="auth-body">
						<div class="auth-item">
							<div class="auth-label">+86</div>
							<div class="auth-input">
								<input type="text" name="mobile" placeholder="输入手机号">
							</div>
						</div>
						<div class="auth-item">
							<div class="auth-input">
								<input type="text" name="vcode" placeholder="输入验证码">
							</div>
							<div class="auth-vcode">
								<a href="javascript:;" @click="sendVcode">获取验证码</a>
							</div>
						</div>
					</div>

					<a href="javascript:;" class="weui-btn weui-btn_primary btn-submit" @click="submitAuth">提交</a>
				</form>
		    </div>
		</wii-popup>
		{%/if%}
		{%/if%}
	</div>
{%/block%}

{%block name="after_body"%}
	{%require name="static/logic/cashier/h5/payment.js"%}
{%/block%}